package com.example.extest;

import android.app.Activity;
import android.os.Bundle;
import android.widget.RatingBar;
import android.widget.RatingBar.OnRatingBarChangeListener;
import android.widget.TextView;

public class ActivityRating extends Activity {
	// @Override
	public void onCreate(Bundle state) {
		super.onCreate(state);
		setContentView(R.layout.rating_layout);
		showRating();
	}
	
	public void showRating(){
		RatingBar rtn = (RatingBar)findViewById(R.id.ratingBar1);
		final TextView txt =  (TextView)findViewById(R.id.txtViewRating);
		
		rtn.setOnRatingBarChangeListener(new OnRatingBarChangeListener() {
			
			@Override
			public void onRatingChanged(RatingBar ratingBar, float rating,
					boolean fromUser) {
				// TODO Auto-generated method stub
				txt.setText(String.valueOf(rating));
			}
		});
	}

}
